Optimal. Leaf size=108 \[ \frac {(c+d x)^2}{2 (a+b) d}-\frac {b (c+d x) \log \left (1+\frac {(a-b) e^{-2 (e+f x)}}{a+b}\right )}{\left (a^2-b^2\right ) f}+\frac {b d \text {PolyLog}\left (2,-\frac {(a-b) e^{-2 (e+f x)}}{a+b}\right )}{2 \left (a^2-b^2\right ) f^2} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.12, antiderivative size = 108, normalized size of antiderivative = 1.00, number of steps
used = 4, number of rules used = 4, integrand size = 18, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.222, Rules used = {3813, 2221,
2317, 2438} \begin {gather*} -\frac {b (c+d x) \log \left (\frac {(a-b) e^{-2 (e+f x)}}{a+b}+1\right )}{f \left (a^2-b^2\right )}+\frac {b d \text {Li}_2\left (-\frac {(a-b) e^{-2 (e+f x)}}{a+b}\right )}{2 f^2 \left (a^2-b^2\right )}+\frac {(c+d x)^2}{2 d (a+b)} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 2221
Rule 2317
Rule 2438
Rule 3813
Rubi steps
\begin {align*} \int \frac {c+d x}{a+b \tanh (e+f x)} \, dx &=\frac {(c+d x)^2}{2 (a+b) d}+(2 b) \int \frac {e^{-2 (e+f x)} (c+d x)}{(a+b)^2+\left (a^2-b^2\right ) e^{-2 (e+f x)}} \, dx\\ &=\frac {(c+d x)^2}{2 (a+b) d}-\frac {b (c+d x) \log \left (1+\frac {(a-b) e^{-2 (e+f x)}}{a+b}\right )}{\left (a^2-b^2\right ) f}+\frac {(b d) \int \log \left (1+\frac {\left (a^2-b^2\right ) e^{-2 (e+f x)}}{(a+b)^2}\right ) \, dx}{\left (a^2-b^2\right ) f}\\ &=\frac {(c+d x)^2}{2 (a+b) d}-\frac {b (c+d x) \log \left (1+\frac {(a-b) e^{-2 (e+f x)}}{a+b}\right )}{\left (a^2-b^2\right ) f}-\frac {(b d) \text {Subst}\left (\int \frac {\log \left (1+\frac {\left (a^2-b^2\right ) x}{(a+b)^2}\right )}{x} \, dx,x,e^{-2 (e+f x)}\right )}{2 \left (a^2-b^2\right ) f^2}\\ &=\frac {(c+d x)^2}{2 (a+b) d}-\frac {b (c+d x) \log \left (1+\frac {(a-b) e^{-2 (e+f x)}}{a+b}\right )}{\left (a^2-b^2\right ) f}+\frac {b d \text {Li}_2\left (-\frac {(a-b) e^{-2 (e+f x)}}{a+b}\right )}{2 \left (a^2-b^2\right ) f^2}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 1.79, size = 94, normalized size = 0.87 \begin {gather*} \frac {f \left ((a+b) f x (2 c+d x)-2 b (c+d x) \log \left (1+\frac {(a+b) e^{2 (e+f x)}}{a-b}\right )\right )-b d \text {PolyLog}\left (2,-\frac {(a+b) e^{2 (e+f x)}}{a-b}\right )}{2 (a-b) (a+b) f^2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(356\) vs.
\(2(107)=214\).
time = 4.45, size = 357, normalized size = 3.31
method | result | size |
risch | \(\frac {d \,x^{2}}{2 b +2 a}+\frac {c x}{a +b}-\frac {b c \ln \left (a \,{\mathrm e}^{2 f x +2 e}+b \,{\mathrm e}^{2 f x +2 e}+a -b \right )}{f \left (a +b \right ) \left (a -b \right )}+\frac {2 b c \ln \left ({\mathrm e}^{f x +e}\right )}{f \left (a +b \right ) \left (a -b \right )}+\frac {b d \ln \left (1-\frac {\left (a +b \right ) {\mathrm e}^{2 f x +2 e}}{-a +b}\right ) x}{f \left (a +b \right ) \left (-a +b \right )}+\frac {b d \ln \left (1-\frac {\left (a +b \right ) {\mathrm e}^{2 f x +2 e}}{-a +b}\right ) e}{f^{2} \left (a +b \right ) \left (-a +b \right )}-\frac {b d \,x^{2}}{\left (a +b \right ) \left (-a +b \right )}-\frac {2 b d e x}{f \left (a +b \right ) \left (-a +b \right )}-\frac {b d \,e^{2}}{f^{2} \left (a +b \right ) \left (-a +b \right )}+\frac {b d \polylog \left (2, \frac {\left (a +b \right ) {\mathrm e}^{2 f x +2 e}}{-a +b}\right )}{2 f^{2} \left (a +b \right ) \left (-a +b \right )}+\frac {b d e \ln \left (a \,{\mathrm e}^{2 f x +2 e}+b \,{\mathrm e}^{2 f x +2 e}+a -b \right )}{f^{2} \left (a +b \right ) \left (a -b \right )}-\frac {2 b d e \ln \left ({\mathrm e}^{f x +e}\right )}{f^{2} \left (a +b \right ) \left (a -b \right )}\) | \(357\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 368 vs.
\(2 (105) = 210\).
time = 0.62, size = 368, normalized size = 3.41 \begin {gather*} \frac {{\left (a + b\right )} d f^{2} x^{2} + 2 \, {\left (a + b\right )} c f^{2} x - 2 \, b d {\rm Li}_2\left (\sqrt {-\frac {a + b}{a - b}} {\left (\cosh \left (f x + \cosh \left (1\right ) + \sinh \left (1\right )\right ) + \sinh \left (f x + \cosh \left (1\right ) + \sinh \left (1\right )\right )\right )}\right ) - 2 \, b d {\rm Li}_2\left (-\sqrt {-\frac {a + b}{a - b}} {\left (\cosh \left (f x + \cosh \left (1\right ) + \sinh \left (1\right )\right ) + \sinh \left (f x + \cosh \left (1\right ) + \sinh \left (1\right )\right )\right )}\right ) - 2 \, {\left (b c f - b d \cosh \left (1\right ) - b d \sinh \left (1\right )\right )} \log \left (2 \, {\left (a + b\right )} \cosh \left (f x + \cosh \left (1\right ) + \sinh \left (1\right )\right ) + 2 \, {\left (a + b\right )} \sinh \left (f x + \cosh \left (1\right ) + \sinh \left (1\right )\right ) + 2 \, {\left (a - b\right )} \sqrt {-\frac {a + b}{a - b}}\right ) - 2 \, {\left (b c f - b d \cosh \left (1\right ) - b d \sinh \left (1\right )\right )} \log \left (2 \, {\left (a + b\right )} \cosh \left (f x + \cosh \left (1\right ) + \sinh \left (1\right )\right ) + 2 \, {\left (a + b\right )} \sinh \left (f x + \cosh \left (1\right ) + \sinh \left (1\right )\right ) - 2 \, {\left (a - b\right )} \sqrt {-\frac {a + b}{a - b}}\right ) - 2 \, {\left (b d f x + b d \cosh \left (1\right ) + b d \sinh \left (1\right )\right )} \log \left (\sqrt {-\frac {a + b}{a - b}} {\left (\cosh \left (f x + \cosh \left (1\right ) + \sinh \left (1\right )\right ) + \sinh \left (f x + \cosh \left (1\right ) + \sinh \left (1\right )\right )\right )} + 1\right ) - 2 \, {\left (b d f x + b d \cosh \left (1\right ) + b d \sinh \left (1\right )\right )} \log \left (-\sqrt {-\frac {a + b}{a - b}} {\left (\cosh \left (f x + \cosh \left (1\right ) + \sinh \left (1\right )\right ) + \sinh \left (f x + \cosh \left (1\right ) + \sinh \left (1\right )\right )\right )} + 1\right )}{2 \, {\left (a^{2} - b^{2}\right )} f^{2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {c + d x}{a + b \tanh {\left (e + f x \right )}}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [F]
time = 0.00, size = -1, normalized size = -0.01 \begin {gather*} \int \frac {c+d\,x}{a+b\,\mathrm {tanh}\left (e+f\,x\right )} \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________